package com.fengye.spring.cloud.gateway.service.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 测试
 * @author sky
 * @date 2021年05月27日 10:44 上午
 */
@RestController
public class TestController {

    /**
     * 测试gateway 响应
     * @return 当前时间
     */
    @GetMapping("/say")
    public String sayHello() {
        LocalDateTime time = LocalDateTime.now();
        String now = time.format(DateTimeFormatter.ofPattern("uuuu/MM/dd HH:mm:ss"));
        return "[spring-cloud-gateway-service]: say hello " + now;
    }
}
